<#assign menuId=3>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>打样订单-${Application.systemName!}</title>
        <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
        <!-- bootstrap 3.0.2 -->
        <link href="../css/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <!-- font Awesome -->
        <link href="../css/font-awesome.min.css" rel="stylesheet" type="text/css" />
        <!-- Ionicons -->
        <link href="../css/ionicons.min.css" rel="stylesheet" type="text/css" />
        <!-- Theme style -->
        <link href="../css/AdminLTE.css" rel="stylesheet" type="text/css" />

        <link href="../css/myself.css" rel="stylesheet" type="text/css" />
        <link rel="stylesheet" href="../css/pagination.css" />
        <link rel="stylesheet" type="text/css" href="../css/bootstrap-select.css">
        <script type="text/javascript" src="../js/lib/jquery.min.js"></script>
		<link rel="stylesheet" type="text/css" href="../css/bootstrap-select.css">
		<link rel="stylesheet" type="text/css" href="../css/datetimepicker/bootstrap-datetimepicker.min.css"/>
		<link rel="stylesheet" type="text/css" href="../css/bootstrapValidator.min.css"/>


        <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
          <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
        <![endif]-->
		<style type="text/css">
			.user-header ul{
				margin-top: 20px; 
				margin-left: 5px;
			}
			.user-header ul li{
				color: rgba(255, 255, 255, 0.8);
				text-align: left; 
				margin-top: 20px;
				font-size: 17px;
			}
			.table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {
			    vertical-align: middle;
			}
			.style-image{
				border: 1px solid #ccc;
				padding: 0;
			}
			.style-image img{
				width: 120px;
				height: 100px;
				cursor: pointer;
			}
			
			/* 弹出大图样式 */
			.Image{
				width: 960px;
			}
			.Image .modal-body {
				position: relative;
			}
			.Image .modal-body img{
				width: 100%;
				height: 540px;
				cursor: pointer;
				position: absolute;
				top: 0;
				left: 0;
				z-index:99;
			}
			.iconR, .iconL{
				position: absolute;
				top: 50%;
				font-size: 50px;
				color: #3882ff;
				cursor: pointer;
				opacity: 0.7;
				margin-top: 20%;
				z-index:2000;
			}
			.iconL{
				left: 10px;
			}
			.iconR{
				right: 10px;
			}
			.tc2_content1_d2{
                width: 90px;
                height: 30px;
                background-color: #5f6571;
                color: #fff;
                text-align: center;
                line-height: 30px;
                border-radius: 15px 0 0 15px;
                position: absolute;
                right: 0;
                top: 20px;
                font-weight: bold;
                z-index:999;
            }
			
			
        	
		</style>
    </head>
    <body class="skin-blue">
        <!-- header logo: style can be found in header.less -->
         <#include "../header.html"/>
        <div class="wrapper row-offcanvas row-offcanvas-left">
            <!-- Left side column. contains the logo and sidebar -->
            <#include "../menu.html"/>

            <!-- Right side column. Contains the navbar and content of the page -->
           <aside class="right-side">
           	<section class="content-header" style="position: relative;">
                    <h1>打样订单</h1>
               		<#if Session["permisionMap"]["F209"]??>
               			<div class="pull-right" style="position: absolute; top: 10px; right: 20px;">
	                    	<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal2">创建打样订单</button>
	                   	</div>
                		<!-- <button type="button" class="btn btn-primary fr margin" data-toggle="modal" data-target="#myModal2">创建打样订单</button> -->
						
               		</#if>
               		<hr style="margin: 10px 0 0 0" />
            </section>
            <section class="content">
            	<div class="row">
            		<div class="col-md-12">
            			<div class="box">
            				<div class="clearfix search-div center">
				                <div  class="fl clearfix" style="margin-bottom: 20px;">
                                    <div class="btn-group" data-toggle="btn-toggle">
                                        <button type="button" onclick="window.location.href='list?pageNo=1'" class="btn btn-default btn-md <#if status??><#else>active</#if>">全部 </button>
						                <button type="button"  onclick="window.location.href='list?pageNo=1&status=20'" class="btn btn-default btn-md  <#if status?? && status==20>active</#if>">待打样</button>
						                <button type="button"  onclick="window.location.href='list?pageNo=1&status=21'" class="btn btn-default btn-md <#if status?? && status==21>active</#if>">打样中</button>
						                <button type="button"  onclick="window.location.href='list?pageNo=1&status=22'" class="btn btn-default btn-md <#if status?? && status==22>active</#if>">待报价</button>
						                <button type="button"  onclick="window.location.href='list?pageNo=1&status=99'" class="btn btn-default btn-md <#if status?? && status==99>active</#if>">已完成</button>
                                    </div>
				                </div>
	            				<div class="search1">
	            				<form id="search_form" action="../proofingorder/list" method="get">
	            				
	            					<ul style="padding: 0; margin-bottom: 0"> 
						       			<li>
											<input type="text" name="code" value="${code!}" placeholder="输入订单号"/>
						       			</li>
						       			<li>
											<input type="text" value="${customerName!}" name="customerName" placeholder="输入客户名称"/>
						       			</li>
						       			<li>
											<button id="search" type="button" class="btn btn-primary btn-sm">搜索</button>
						       			</li>
						       		</ul>
                            	</form>
	            				</div>
	            				
                            </div><!-- /.box-header -->
				            <div class="clearfix search-div center" style="margin-top:0;">
				            <div class="clearfix"></div>
						           	<table class="table table-bordered text-center">
						               	<tbody>
						                   	<tr>
						                       <th style="border: 0;" width="36%">客户信息</th>
						                       <th style="border: 0;" width="16%">打样数量</th>
						                       <th style="border: 0;" width="16%">工厂</th>
						                       <th style="border: 0;" width="16%">状态</th>
						                       <th style="border: 0;" width="16%">操作</th>
						                   	</tr>
						               	</tbody>
						           	</table>
						        
                                	<#list proofingOrders as proofingOrder>
                                	
                                	<table class="table table-bordered text-center order-list">
                                		<tr>
				                    		<td  colspan="5"  class="left-text" style="font-weight: bold;">
				                    			<div class="pull">
				                    				<span class="pull-left" style="border: none;">
					                    				<span>
					                    					${proofingOrder.createAt?string("yyyy/MM/dd")}
					                    				</span>&nbsp;&nbsp;&nbsp;
					                    				<span>订单号：${proofingOrder.code!}</span>
					                    			</span>
					                    			<span class="pull-right">
					                    				<span>客户交期：</span>
					                    				  <#if proofingOrder.enddateCnt??>
					                                      <#if proofingOrder.enddateCnt gt 0>
					                                      <span >剩余 <span>${proofingOrder.enddateCnt?abs}</span>天</span>
					                                      </#if>
					                                      <#if proofingOrder.enddateCnt lt 0>
					                                      <span class="red">超期<span>${proofingOrder.enddateCnt?abs}</span>天</span>
					                                      </#if>
					                                       <#if proofingOrder.enddateCnt==0>
					                                      <span >剩余 <span>${proofingOrder.enddateCnt?abs}</span>天</span>
					                                      </#if>
					                                    </#if>
					                    			</span>
				                    			</div>
				                    		</td>
				                    	</tr>
                                		<tr>
				                    		<td style="border: 0; width: 36%; text-align: left;">
				                    			<#if proofingOrder.customer.level=="V1">
					                            <i class="iconfont fl">&#xe6eb;</i>
					                            <#elseif proofingOrder.customer.level=="V2">
					                            <i class="iconfont fl">&#xe6ed;</i>
					                            <#else>
					                            <i class="iconfont fl">&#xe6e9;</i>
					                            </#if>
					                            <div  class="order-text">
						                            <p>
							                            <a id="name" href="../customer/doShowCustomerDetailPage?id=${proofingOrder.customer.id}">${proofingOrder.customer.fullname!}</a>
							                            <#if proofingOrder.customer.web??  && proofingOrder.customer.web!="">
							                            <a href="${proofingOrder.customer.web}"><i class="iconfont">&#xe6ee;</i></a>
							                            </#if>
							                            <#if proofingOrder.customer.attachment?? && proofingOrder.customer.attachment?size!=0>
							                            <a href="javascript:;"><i class="iconfont" data-toggle="modal" data-target="#myModal1">&#xe6ef;</i></a>
						                            	<!-- 下载列表 -->
						                            	<div class="modal fade" id="myModal1"  tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
															<div class="modal-dialog down_load">
																<div class="modal-content"> 
																	<div class="modal-header">
																		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
																			&times;
																		</button>
																		<h4 class="modal-title">
																			下载列表
																		</h4>
																	</div>
																	<div class="modal-body"> 
																		<ul>
																			<#list proofingOrder.customer.attachment as attach>
																			<li>
																				<div class="clearfix">
																					<a href="../businessfile/downFile?businessFileId=${attach.id!}"><img class="pull-left" src="../img/file.png" style="width: 60px; height: 60px; border-radius: 10px;"/></a>
																					<span class="pull-left" title="${attach.originName!}">${attach.originName!}</span>
																				</div>
																			</li>
																			</#list>
																		</ul>
																	</div>
																	<div class="modal-footer">
																		<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
																	</div>
																</div><!-- /.modal-content -->
															</div><!-- /.modal -->
														</div>
						                            	</#if>
						                            </p>
						                            <p>
						                            	
						                            	<!-- <i class="iconfont">&#xe6f5;</i> -->
							                            	<!-- <span style="margin-right: 15px;">张小姐</span>
							                            	<i class="iconfont">&#xe6f3;</i>
							                            	<span>182111111111</span> -->
						                            	
						                            	
						                           		产品分类：<#list proofingOrder.customer.productCategory as ca>${ca!}&nbsp;</#list>
						                            </p>
						                            <p><i class="iconfont">&#xe6f4;</i>
				                    				客户需求：${proofingOrder.requirement!}</p>
					                            </div>
				                    		</td>
				                    		<#assign dyCntSum= 0>
				                    		<#list proofingOrder.proofingPatternResults as proofingPatternResult>
				                    	
				                    	<#assign dyCntSum= dyCntSum + proofingPatternResult.dyCnt!>
				                    	</#list>
				                    		<td style="border-bottom: 0; width: 16%;">${dyCntSum}</td>
				                    		<td style="border-bottom: 0; width: 16%;"></td>
				                    		<td style="border-bottom: 0; width: 16%;"  class="red">
				                    		<#if proofingOrder.status==20>待打样<#elseif proofingOrder.status==21>打样中<#elseif proofingOrder.status==22>待报价<#elseif proofingOrder.status==99>已完成<#elseif proofingOrder.status==100>已关闭</#if>
				                    		
				                    		</td>
				                    		<td style="border-bottom: 0;width: 16%;">
				                    		<#if (Session["permisionMap"]["F109"]??) && proofingOrder.status lt 100>
				                		<#if proofingOrder.manager??>
				                		<div>
			                				<a class="btn btn-primary btn-sm" style="margin-bottom: 10px" data-toggle="modal" data-target="#assign_manager_${proofingOrder_index}">修改项目经理</a>
			                			</div>
				                		<#else>
				                		<div>
			                				<a class="btn btn-primary btn-sm" style="margin-bottom: 10px" data-toggle="modal" data-target="#assign_manager_${proofingOrder_index}">指派项目经理</a>
			                			</div>
				                		</#if>
				                		
				                		
											 <div class="modal fade" id="assign_manager_${proofingOrder_index}"  tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
																			<div class="modal-dialog">
												<div class="modal-content">
													<div class="modal-header">
														<button type="button" class="close" data-dismiss="modal" 
																aria-hidden="true">×
														</button>
														<h4 class="modal-title" id="myModalLabel">
															指派项目经理
														</h4>
													</div>
													<div class="modal-body">
										<form id="assignManagerForm_${proofingOrder_index}">
										<table class="table table-bordered">
                                        <tbody><tr>
                                            <th style="width: 80px">选择</th>
                                            <th>账号</th>
                                            <th>姓名</th>
                                        </tr>
                                        <#list managerList as sysUser>
                                        <tr>
                                            <td><input type="radio" name="manager" value="${sysUser.id!}" <#if proofingOrder.manager?? && proofingOrder.manager==sysUser.id>checked="checked" </#if>/></td>
                                            <td>${sysUser.email!}</td>
                                            <td>${sysUser.name!}</td>
                                        </tr>
                                       </#list>
                                    </tbody></table>
									</form>
										</div>
										<div class="modal-footer">
											<button type="button" class="btn btn-default" 
													data-dismiss="modal">关闭
											</button>
											<button type="button" onclick="assignManager('assignManagerForm_${proofingOrder_index}',${proofingOrder.orderId},${proofingOrder.id})" id="btnassignuser" class="btn btn-primary">
												提交
											</button>
										</div>
									</div><!-- /.modal-content -->
								</div><!-- /.modal-dialog -->
							</div><!-- /.modal -->
				                		</#if>
				                		<#if (Session["permisionMap"]["F204"]??)  && proofingOrder.status==99>
               			<a  href="javascript:saveClose(${proofingOrder.id})" class="btn btn-primary btn-sm" style="margin-bottom: 10px">关闭订单</a>
               		 </#if>
							                    		
					<#if (Session["permisionMap"]["F205"]??)  && proofingOrder.status==99 && proofingOrder.productionOrderList?size == 0>
               			
               			<a  href="window.location.href='../productionorder/create?orderId=${proofingOrder.orderId}&proofingOrderId=${proofingOrder.id}'" class="btn btn-primary btn-sm" style="margin-bottom: 10px">创建大货订单</a>
               		 </#if>
               		 <div>
				                    		<a href="detail?proofingPatternId=${proofingOrder.id}">订单详情</a>
				                    		</div>
				                    		</td>
				                    	</tr>
				                    	
				                    	<#if proofingOrder.proofingPatternResults??>
				                    	<#list proofingOrder.proofingPatternResults as proofingPatternResult>
				                    	
                                		<tr>
				                    		<td  style="border: 0; padding-top: 0;" colspan="5">
				                    			<table class="table table-bordered text-center order-list">
				                    				<tr>
								                       	<td colspan="5" class="left-text">
								                           	<span>子订单号：${proofingPatternResult.orderPattern.code!}</span>
								                       	</td>
								                   	</tr>
				                    				<tr>
				                    					<td style="width: 36%; text-align: left;">
							                    			<div class="style-content">
							                    				<span class="style-image" onclick="showImage('${proofingPatternResult.orderPatternId!}','${proofingPatternResult.mainImage!}')">
								                    				<img src="${Application.accessFileUrl}/${proofingPatternResult.mainImage!}" alt="款式图1" data-toggle="modal" data-target="#show_image" />
								                    			</span>
								                    			
								                    			<span class="style-number">
								                    				<div>设计编号：${proofingPatternResult.orderPattern.patternNo!}</div>
								                    				<div style="color: #bbb;">创建时间：<#if proofingOrder.createAt??>${proofingOrder.createAt?string("yyyy-MM-dd HH:mm:ss")}</#if></div>
								                    			</span>
								                    			<div class="clear" style="clear: both;"></div>
							                    			</div>
							                    		</td>
							                    		<td style="width: 16%;">${proofingPatternResult.dyCnt!}</td>
							                    		<td style="width: 16%;"><#if proofingPatternResult.factory??> ${proofingPatternResult.factory.name!}</#if></td>
							                    		<td style="width: 16%;">	<#if proofingPatternResult.status==20>待打样<#elseif proofingPatternResult.status==21>打样中<#elseif proofingPatternResult.status==22>待报价<#elseif proofingPatternResult.status==99>已完成<#elseif proofingPatternResult.status==100>已关闭</#if></td>
							                    		<td style="width: 16%;">
							                    		
							                    		
							                    		
							                    		
							                    		
							                    		
							                    	<#if (Session["permisionMap"]["F210"]??)  && proofingPatternResult.status == 20>
							                    			
							                    			<div>
							                    				<a class="btn btn-primary btn-sm" style="margin-bottom: 10px" data-toggle="modal" data-target="#myModal_${proofingPatternResult.id}">${Session["permisionMap"]["F210"].name!}</a>
							                    			</div>
							                    			
								                            <div class="modal fade" id="myModal_${proofingPatternResult.id}"  tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
																
				<div class="modal-dialog" style="width:800px">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
								&times;
							</button>
							<h4 class="modal-title" id="myModalLabel">
								填写面料信息
							</h4>
						</div>
						<div class="modal-body">
						<textarea id="accessoryDetail_${proofingPatternResult.id}">${proofingPatternResult.accessoryDetail!}</textarea>
	                  
						</div>
						<div class="modal-footer">
							<button type="button" onclick="saveMaterialFunc('accessoryDetail_${proofingPatternResult.id}',${proofingPatternResult.id},${proofingOrder.id})" class="btn btn-primary">确定
							</button>
							<button type="button" class="btn btn-default" data-dismiss="modal">
								取消
							</button>
						</div>
					</div><!-- /.modal-content -->
				</div><!-- /.modal -->
				
			</div>
							                    			
							                    			
							                    			
							                    		</#if>
							                    		<#if (Session["permisionMap"]["F201"]??)  && proofingPatternResult.status == 20>
							                    			
				<a class="btn btn-primary btn-sm" style="margin-bottom: 10px" data-toggle="modal" data-target="#uploadSizeFile_${proofingPatternResult.id}">${Session["permisionMap"]["F201"].name!}</a>
								                            <div class="modal fade" id="uploadSizeFile_${proofingPatternResult.id}"  tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
															<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
								&times;
							</button>
							<h4 class="modal-title" id="myModalLabel">
								上传尺码表
							</h4>
						</div>
						<div class="modal-body">
						<textarea id="detailDescription_${proofingPatternResult.id}">${proofingPatternResult.detailDescription!}</textarea>
	                  
						</div>
						<div class="modal-footer">
							<button type="button" onclick="saveUploadSizefile('detailDescription_${proofingPatternResult.id}',${proofingPatternResult.id},${proofingOrder.id})" class="btn btn-primary">确定
							</button>
							<button type="button" class="btn btn-default" data-dismiss="modal">
								取消
							</button>
						</div>
					</div><!-- /.modal-content -->
				</div><!-- /.modal -->
			</div>
							                    		</#if>
							                    		<#if (Session["permisionMap"]["F203"]??)  && proofingPatternResult.status == 22>
							                    		<div>
							                    			<a class="btn btn-primary btn-sm" name="quote" style="margin-bottom: 10px" data-toggle="modal" data-target="#bidprice_add_${proofingPatternResult.id}">${Session["permisionMap"]["F203"].name!}</a>
							                    		</div>
							                    		
								                            <div class="modal fade" id="bidprice_add_${proofingPatternResult.id}"  tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
									
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
								&times;
							</button>
							<h4 class="modal-title" id="myModalLabel">
								报价
							</h4>
						</div>
						<div class="modal-body">
							<form class="form-horizontal" role="form" id="bidprice_add_form_${proofingPatternResult.id}">

  <div class="form-group">
                  <label for="inputEmail3" class="col-sm-2 control-label">成本价</label>

                  <div class="col-sm-10">
                    <input class="form-control" name="costPrice" placeholder="成本价" value="" type="text">
                  </div>
                </div>
                <div class="form-group">
                  <label for="inputEmail3" class="col-sm-2 control-label">最低销售价</label>

                  <div class="col-sm-10">
                    <input class="form-control" name="minSalePrice" placeholder="最低销售价" type="text">
                  </div>
                </div>
                <div class="form-group">
                  <label for="inputEmail3" class="col-sm-2 control-label">市场零售价</label>

                  <div class="col-sm-10">
                    <input class="form-control" name="salePrice" placeholder="市场零售价" type="text">
                  </div>
                </div>
			            </form>	
						</div>
						<div class="modal-footer">
							<button type="button" onclick="saveBidPriceAdd('bidprice_add_form_${proofingPatternResult.id}',${proofingPatternResult.id},${proofingOrder.id})" class="btn btn-primary">确定
							</button>
							<button type="button" class="btn btn-default" name="repeal" data-dismiss="modal">
								取消
							</button>
						</div>
					</div><!-- /.modal-content -->
				</div><!-- /.modal -->
			</div>
							                    		</#if>
							                    		<#if (Session["permisionMap"]["F202"]??)  && proofingPatternResult.status ==21>
							                    			<button type="button" onclick="saveMakeStatus(${proofingPatternResult.id},${proofingOrder.id})" class="btn btn-primary btn-sm">批版通过</button>
							                    		</#if>
							                    	
							                    	
							                    	
							                    	 <#if proofingOrder.manager?? && (Session["permisionMap"]["F200"]??) && proofingOrder.manager==Session["userId"]>
                                                <#if proofingPatternResult.status gt 20>
                                             	<a href="fillNotice?ids=${proofingPatternResult.id}&proofingOrderId=${proofingOrder.id}" class="btn btn-primary btn-sm">修改打样通知单</a>
                                             	<#if (Session["permisionMap"]["F208"]??)>
                                             <a href="downPdf?id=${proofingPatternResult.id!}" class="btn btn-primary btn-sm">下载打样通知单</a>
                                               </#if>
                                                <#else>
                                                <a href="fillNotice?ids=${proofingPatternResult.id}&proofingOrderId=${proofingOrder.id}" class="btn btn-primary btn-sm">填写打样通知单</a>
                                                </#if>
                                               </#if>
							                    		
							                    		</td>	
				                    				</tr>
				                    			</table>
				                    		</td>
				                    	</tr>
				                    	</#list>
				                    	</#if>
						       		</table>
						       		</#list>
						  
							     <div class="box-footer clearfix">
                                    <ul class="pagination pagination-sm no-margin pull-right">
                                        <#if splitPage??> ${splitPage?replace("{url}","${url!}")}</#if>
                                    </ul>
                                </div>
				           	</div>
            			</div>
            		</div>
            	</div>
            </section>
            </aside><!-- /.right-side -->
			
			
			<!--创建打样订单弹框-->
          	<div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
				<div class="modal-dialog DaYang" >
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
								&times;
							</button>
							
						</div>
						<div class="modal-body">
							<a href="addSample" class="customers_a"  style="position: relative;">
								<span>客户提供样衣</span>
								<i class="iconfont icon_i1">&#xe6f6;</i>
								<div class="bg_customer">
									<img src="../img/ic_people.png">
								</div>
							</a>
							<a href="selectSample" class="yangyi_a" style="position: relative;">
								<span>从样衣库中选择</span>
								<i class="iconfont icon_i2">&#xe6f6;</i>
								<div class="bg_customer">
									<img src="../img/ic_cloth.png">
								</div>
							</a>
							<!--<div class="yangyi clearfix">
								<i class="iconfont">&#xe6f5;</i>
								<a href="DaYang_new.html" class="btn btn-primary pull-right">客户提供样衣</a>
							</div>
							<div class="yangyi clearfix">
								<i class="iconfont">&#xe6e7;</i>
								<a href="DaYang_new.html" class="btn btn-primary pull-right">从样衣库中选择</a>
							</div>-->
						</div>
						
					</div><!-- /.modal-content -->
				</div><!-- /.modal -->
			</div>
			
			<div class="modal fade" id="show_image" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
				<div class="modal-dialog Image">
					<div class="modal-content">
						<div class="modal-body">
							<!-- <img src="../images/Design_draft_03.jpg" alt="" />
							<img src="../images/Design_draft_03.jpg" alt="" /> -->
							<!-- <div class="iconR">&lt;</div>
							<div class="iconL">&gt;</div> -->
							<i class="fa fa-chevron-right iconR"></i>
							<i class="fa fa-chevron-left iconL"></i>
							<div class="tc2_content1_d2">&lt;   <span id="num">1</span>  /   <span id="max">1</span>   &gt;</div>
						</div>
					</div><!-- /.modal-content -->
				</div><!-- /.modal -->
			</div>
        </div><!-- ./wrapper -->
        <!-- jQuery 2.0.2 -->
		<input type="hidden" id="proofingOrderId" name="proofingOrderId"/>
                    <input type="hidden" id="proofingPatternId" name="proofingPatternId"/>
       
        <script src="../js/jquery.min.js" type="text/javascript"></script>
        <!-- Bootstrap -->
        <script src="../js/bootstrap.min.js" type="text/javascript"></script>
        <!-- AdminLTE App -->
        <script src="../js/AdminLTE/app.js" type="text/javascript"></script>
        <script type="text/javascript" src="../js/bootstrap-select.js"></script> 
        		<script src="../js/jquery.form.min.js"></script>
        <!--datepickes-->
		<script src="../js/plugins/datetimerpicker/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
	   <!-- CK Editor -->
        <script src="../js/plugins/ckeditor/ckeditor.js" type="text/javascript"></script>
        <script src="../js/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js" type="text/javascript"></script>
        <script src="../js/bootstrapValidator.min.js" type="text/javascript"></script>
       	
		<script src="../js/plugins/datetimerpicker/locales/bootstrap-datetimepicker.zh-CN.js" type="text/javascript"></script>
        <script src="../js/order/proofing_list.js"></script>
        <script type="text/javascript">
        
        var ckEditorMap = {};
        $(function(){ 
        	 <#list proofingOrders as proofingOrder>
             <#list proofingOrder.proofingPatternResults as proofingPatternResult>
             <#if (Session["permisionMap"]["F210"]??)  && proofingPatternResult.status == 20>
             
             ckEditorMap['accessoryDetail_${proofingPatternResult.id}']=CKEDITOR.inline('accessoryDetail_${proofingPatternResult.id}',{
             	 toolbar :
                      [
          　　　　　　　　  //加粗     斜体，     下划线      穿过线      下标字        上标字
                         ['Bold','Italic','Underline','Strike','Subscript','Superscript'],
          　　　　　　　　  //左对齐             居中对齐          右对齐          两端对齐
                         ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
          　　　　　　　　  //图片  表格
                         ['Image','Table'],
                         '/',
          　　　　　　　　　//字体    字体大小
                         ['Font','FontSize'],
          　　　　　　　　  //文本颜色     背景颜色
                         ['TextColor','BGColor'],
          　　　　　　　　　//显示区块
                         ['ShowBlocks','-']
                       ]
             });
             </#if>
             <#if (Session["permisionMap"]["F201"]??)  && proofingPatternResult.status == 20>
             ckEditorMap['detailDescription_${proofingPatternResult.id}']=CKEDITOR.inline('detailDescription_${proofingPatternResult.id}',{
            	 toolbar :
                     [
         　　　　　　　　  //加粗     斜体，     下划线      穿过线      下标字        上标字
                        ['Bold','Italic','Underline','Strike','Subscript','Superscript'],
         　　　　　　　　  //左对齐             居中对齐          右对齐          两端对齐
                        ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
         　　　　　　　　  //图片  表格
                        ['Image','Table'],
                        '/',
         　　　　　　　　　//字体    字体大小
                        ['Font','FontSize'],
         　　　　　　　　  //文本颜色     背景颜色
                        ['TextColor','BGColor'],
         　　　　　　　　　//显示区块
                        ['ShowBlocks','-']
                      ]
            });
             </#if>
             //bootstrap WYSIHTML5 - text editor
             $(".textarea").wysihtml5();
             </#list>
             </#list>
        }); 
        
        //搜索按钮点击
        $('#search').click(function(){
        	$('#search_form').submit();
        });
       
        /* 弹出图片框鼠标悬浮事件 */
        $('.iconR').hide();
		$('.iconL').hide();
        
        $( ".Image" ).hover(
		  function() {  
			  $('.iconR').show();
			    $('.iconL').show();  
			  }, function() {  
				  $('.iconR').hide();
				    $('.iconL').hide(); 
			  } 
		);  
        
        function showImage(id,main){
        	$.ajax({
        		url:'../orderpattern/showImage',
        		type:'get',
        		data:{orderPatternId:id},
        		dataType:'json',
        		async:false,
        		success:function(result){
        			if(result.head.respCode='0000000'){
        				var image=result.body;
        				var div=$('#show_image').find('.modal-body');
        				div.find('img').remove();
        				div.find('#max').html(image.length);
        				for(var i=0;i<image.length;i++){
        					var path='${Application.accessFileUrl}'+image[i];
        					var img=$('<img src="'+path+'"></img>');
        					div.find('.iconR').before(img);
        					img.hide();
        					if(image[i]==main){
        						div.find('#num').html(i+1);
        						img.show();
        					}
        				}
        				div.find('.iconR').click(next);
        				div.find('.iconL').click(last);
        			}
        		}
        	});
        }
        function next(){
        	var span=$(this).parent().find('#num');
        	var num=span.html();
        	num=parseInt(num);
        	var max=$(this).parent().find('#max').html();
        	if(num==max) return;
        	$(this).parent().find('img').eq(num).show();
        	$(this).parent().find('img').eq(num-1).hide();
        	span.html(++num);
        }
        
        function last(){
        	var span=$(this).parent().find('#num');
        	var num=span.html();
        	num=parseInt(num);
        	if(num==1) return;
        	$(this).parent().find('img').eq(num-2).show();
        	$(this).parent().find('img').eq(num-1).hide();
        	span.html(num-1);
        }
        function assignManager(formId,businessId,proofingOrderId){
			$("#"+formId).ajaxSubmit({  
	            type : "POST",  
	            url : "../order/assignManager",   
	            dataType : "json",  
	            data:{businessIds:businessId,proofingOrderId:proofingOrderId},
	            contentType : 'application/x-www-form-urlencoded; charset=UTF-8',  
	            success : function(map) {  
	            	
	                if(map.head.respCode=="0000000"){
	                	success("保存成功",function(){
	                		window.location.href="list?pageNo=${pageNo!}";
	                	});
					    
	                }else{
	                	alert(map.body);
	                }
	            },  
	            error : function(map) {  
	                alert("出现错误，请刷新页面");  
	            }  
	  
	        }) 
		}
        $(function(){
        	$('[name=quote]').click(checkForm);
        	$('[name=repeal]').click(destroy);
        })
        
        function checkForm(){
        	var form=$(this).parent().next().find('form');
        	form.bootstrapValidator({
        		fields: {
   					costPrice: {
   						trigger:'blur',
      					validators: {
  		              		notEmpty: {
  		                 		message: '成本价不能为空'
  		              		},
	  		              	regexp: {
		                        regexp: /^\d{1,6}(\.\d{1,2})?$/,
		                        message: '成本价不符'
		                    }
      			  		}
   					},
   					minSalePrice: {
   						trigger:'blur',
      					validators: {
  		              		notEmpty: {
  		                 		message: '最低销售价不能为空'
  		              		},
	  		              	regexp: {
		                        regexp: /^\d{1,6}(\.\d{1,2})?$/,
		                        message: '最低销售价不符'
		                    }
      			  		}
   					},
   					salePrice: {
   						trigger:'blur',
      					validators: {
  		              		notEmpty: {
  		                 		message: '市场零售价不能为空'
  		              		},
	  		              	regexp: {
		                        regexp: /^\d{1,6}(\.\d{1,2})?$/,
		                        message: '市场零售价不符'
		                  	}
      			  		}
   					}
        		}
        	});
        }
        
        function destroy(){
        	$(this).parent().prev().find('form').data('bootstrapValidator').destroy();
        }
        
        function saveClose(proofingOrderId){
        	$.ajax({  
	            type : "POST",  
	            url : "saveClose",   
	            dataType : "json",  
	            data:{proofingOrderId:proofingOrderId}, 
	            success : function(map) {  
	            	if(map.head.respCode=="0000000"){
	                	alert("保存成功");
	                	window.location.href="list";
	                }else{
	                	alert(map.body);
	                }
	            },  
	            error : function(map) {  
	                alert("出现错误，请刷新页面");  
	            }  
	  
	        }) 
        }
        </script>
     
    </body>
</html>

